<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>三栏布局</title>
    <style>
        body{
            margin: 0;
            padding: 0;
        }
        .container{
            position: relative;
            height: 50px;
        }
        .left{            
            position: absolute;
            left: 0;
            width: 200px;
            height: 100%;
            background-color: skyblue;
        }
        .center{
            padding: 0 200px;            
            width: 100%;
            height: 100%;
            background-color: orange;
            box-sizing: border-box;
        }
        .right{
            position: absolute;
            right: 0;
            top: 0;
            width: 200px;
            height: 100%;
            background-color: darkseagreen;
        }

        .container2{
            display: flex;
            height: 50px;
        }
        .left2{            
            width: 200px;
            height: 100%;
            background-color: skyblue;
        }
        .center2{
            flex: 1;           
            height: 100%;
            background-color: orange;
        }
        .right2{            
            width: 200px;
            height: 100%;
            background-color: darkseagreen;
        }

        .container3{
            width: 100%;
            height: 50px;
        }
        .left3{       
            float: left;     
            width: 200px;
            height: 100%;
            background-color: skyblue;
        }
        .center3{
            float: left; 
            width: calc(100% - 200px - 200px);
            height: 100%;
            background-color: orange;
        }
        .right3{      
            float: left;       
            width: 200px;
            height: 100%;
            background-color: darkseagreen;
        }

        .container4{
            display: grid;
            grid-template-columns: 200px auto 200px;
            grid-template-rows: 50px;
            /* width: 100%; */
            /* height: 50px; */
        }
        .left4{       
            background-color: skyblue;
        }
        .center4{
            background-color: orange;
        }
        .right4{      
            background-color: darkseagreen;
        }

        .container5{
            position: relative;
            width: 100%;
            height: 50px;
        }
        .left5{       
            position:absolute;
            left: 0;    
            width: 200px;
            height: 100%;
            background-color: skyblue;
        }
        .center5{            
            position:absolute;
            left: 200px;
            right: 200px;
            height: 100%;
            background-color: orange;
        }
        .right5{      
            position:absolute;
            top: 0;
            right: 0;      
            width: 200px;
            height: 100%;
            background-color: darkseagreen;
        }
        


    </style>
</head>
<body>
    <p>左右position定位，中间宽100%自适应 + 左右padding + box-sizing</p>
    <div class="container">
        <div class="left">Left</div>
        <div class="center">Center</div>
        <div class="right">Right</div>
    </div>
    <p>flex布局，中间宽flex：1自适应</p>
    <div class="container2">
        <div class="left2">Left</div>
        <div class="center2">Center</div>
        <div class="right2">Right</div>
    </div>
    <p>左中右float成一行，中间宽用calc(100% - 200px - 200px)自适应</p>
    <div class="container3">
        <div class="left3">Left</div>
        <div class="center3">Center</div>
        <div class="right3">Right</div>
    </div>
    <p>grid布局，设置为三列，中间auto表示剩余最大宽度，grid-template-columns: 200px auto 200px;</p>
    <div class="container4">
        <div class="left4">Left</div>
        <div class="center4">Center</div>
        <div class="right4">Right</div>
    </div>
    <p>左右position定位，中间position定位：left：200px；right：200px</p>
    <div class="container5">
        <div class="left5">Left</div>
        <div class="center5">Center</div>
        <div class="right5">Right</div>
    </div>
</body>
</html>